<template>
  <dl>
    <dt>背景设置</dt>
    <dd>
      <ColorSet @change="onChangeColor" :c="background.color"/>
      <ImgSingle :src="background.image" @change="(src) => { background.image = src }"/>
    </dd>
  </dl>
</template>

<script>
import dataApi from '@/view/v/data-api'
import ImgSingle from '../SetControlItem/ImgSingle'
import ColorSet from './ColorSet'
export default {
  components: {
    ImgSingle,
    ColorSet
  },
  computed: {
    background () {
      return dataApi.core.background
    }
  },
  methods: {
    onChange ({ target }) {
      this.background.image = target.value
    },
    onChangeColor (v) {
      this.background.color = v
    }
  }
}
</script>
